﻿#include<iostream>


using namespace std;

class A  {

public: virtual A * talk(int x = 1) {
	cout << "我来咯" <<"->"<<x << endl;
	return this;
}

};
class B : public A{

public:
	virtual B* talk(int x = 0) {
	 
	cout << "你来咯" << "->" << x<< endl;
	return this;
}

};
//void f(A& p) {
//	p.talk();
//}

//int main() {
//	A a;
//	B b;
//	/*f(a);
//	f(b);*/
//	A& aa = a;
//	A& bb = b;
//	aa.talk();
//	bb.talk();
//
//	return 0;
//}
//
//

class per
{
public:
	virtual void talk () = 0;
	
};
class zhangsan:public per
{
public:
	virtual void talk()
	{
		cout << "我是张三" << endl;
	}
};
class lisi:public per
{
public:
	virtual void talk()
	{
		cout << "我是李四" << endl;
	}
};
#if 0
int main()
{
	
	//per s;
	per* zs = new zhangsan;
	zs->talk();
	per* ls = new lisi;
	ls->talk();
	return 0;
}
#endif









